home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
comm
/
tlx_sq21.zip
/
LOGON.SLT
< prev
next >
Wrap
Text File
|
1992-03-22
|
35KB
|
984 lines
//-----------------------------------------------------------
// LOGON.SL? Automatic logging into any BBS.
//-----------------------------------------------------------
// Please look at the comments through the whole file, and modify to
// suit your needs before you use it. Then recompile with CS LOGON.
// Modify your dialing directory as follows: linked script should be
// set to LOGON, and your password should be set to whatever it is.
//-----------------------------------------------------------
// If you have suggestions for improving this script, please suggest
// improvements to me via old-fashioned snail-mail to:
// Author: Inge Vabekk
// Hamangskogen 108
// N-1300 SANDVIKA
// NORWAY
// tel. (472) 546 396
// Various variable strings.
str bbs_type [32] // BBS type.
,bbs_name [32] // BBS name.
,User [32] // Your own name.
,Suser [32] // Save user name.
,logfile [32] // Log file name.
,catfile [32] // Catalog file name.
,shortname[ 8] // BBS name,
,codename [ 8] // ID-code,
,help [80] // For various help
,lline [60] // Read last line.
,input [144] // Input line (from file).
,check [4] // For checking "short" globals.
// Script names.
,upload [] = "UPLOAD" // Name of upload script.
,grabmail[] = "GRABMAIL" // Name of GrabMail script.
,getname [] = "GETNAME" // Name of GetName script.
,newfiles[] = "NEWFILES" // Name of NewFiles script.
,modscript[]= "MOD.SLC" // Name of MOD script.
,dnload [] = "DNLOAD" // Name of download script.
,mailup [] = "MAILUP" // Name of mail upload script.
,PutLine [] = "PUTLINE" // Name of put line script.
,ssl [] = "SSL" // Name of status line script.
,global [] = "GLOBAL" // Global script
,show [] = "DISPLAY" // Display logoff/exit status
,conflist[] = "CONFLIST" // Get conference list (MBBS only)
,BBSHOOK[65]= " " // Name of BBS hook script.
// Global variable names
,bbsname []="BNAME" // BBS name.
,cname []="CNAME" // Codename for current BBS
,bbstype []="BTYPE" // BBS type
,mscript []="MDOOR" // Mail script/door
,short []="SHORT" // Shortened BBS name
,conf []="CONF" // Current conference
,username[]="NAME" // User name
,addr []="ADDR" // User's address
,dpass []="DPASS" // Default password
,passw []="PASSW" // Current password
,graph []="GRAPH" // Graphics: YES or NO
,cprot []="CPROT" // Current protocol
,hprot []="HPROT" // "His" protocol
,version []="BBSVER" // BBS version
,logoff []="LOGOF" // Auto-Logof setting
,changed []="CHANGE" // Status line changed
,reader []="READER" // Offline reader in use
,newmes []="NEWMES" // Directory of new messages
,getnew []="NEWFIL" // New files wanted?
,rmode []="RMODE" // Read mode
,fixup []="FIXUP" // Fix setup (MBBS)
,gconflst[]="CNFLST" // Get conference list?
;
int tol = 300 // No activity for 30 seconds
,stat, tmark // makes script time out.
,pcb=0 // 1 for PCBoard, 2 for ProLogon, otherwise 0.
,mbbs=0 // TRUE for MBBS
,rbbs=0 // TRUE for RBBS
,opus=0 // TRUE for OPUS
,atari=0 // TRUE for ATARI
,crcs=0 // TRUE for CRCS
,wildcat
,BBSver // BBS version no.
,y // Y coordinate for writing on screen.
,pw1, pw2 // Trig for password request
,ppass // =1 if BBS script should send password.
,xboard = 0 // =1 if XBoard is being used
,Enter = 13 // Code for Enter.
;
//-----------------------------------------------------------
// Script starts here.
//-----------------------------------------------------------
main()
{
int c, error, i, l, na, t1, t2, lf, lfs;
int pcb1, pcb2 // Trigs for various PCBs
,mbbs1 // trig for MBBS 9.9 and above
,opus1, atar1, crcs1 // trig for OPUS/Atari/crcs
,wild1 // trig for WildCat!
,esc
,more
,WantGrab
;
// Only if online.
entry();
keyset (0x1000,0,"@Logoff"); // Set the Alt-Q key.
i = 0;
while (!carrier())
{ delay(1);
if (++i > 10)
if (!carrier())
{ failtone();
release();
status_wind ("T²: THE LOGON SCRIPT ONLY WORKS IF YOU'RE ONLINE!",20);
return (-1);
}
}
ppass = 1; // Send password is default.
clear_scr();
// Only if the Global script is loaded.
//-----------------------------------------------------------
if (!is_loaded(global)) // If Global script is not
{ box (13,7,62,14,176,1,15);
box (15,8,60,13,177,1,15);
box (17,9,58,12,178,1,15);
pstraxy (" Sorry - the LOGON script only works ",18,10,79);
pstraxy (" if you execute the Qdial script first! ",18,11,79);
gotoxy (0,20);
failtone();
goto end2;
}
// Start all tracking at once - just in case something takes long.
pcb1 = track ("nter Lang",0); // Check for PCboard / ProLogon
pcb2 = track (" graphics",0);
esc = track ("ss Escape",0); // Press Escape?
mbbs1 = track (") MBBS",0); // Check for MBBS
opus1 = track ("OPUS",0); // Check for OPUS BBS
atar1 = track ("Atari ST",0); // Check for Atari MiniBBS
wild1 = track ("[N]onStop? [",0); // Check for WildCat!
crcs1 = track ("CRCS system ",0); // Check for CRCS
more = track ("--more--",0); // Check for the "more" prompt
na = track (" your first na", 1); // Request for name.
lf = track ("^J", 0); // Track linefeed.
lfs = 0;
if (!strlen(Suser))
read (Username,Suser); // Get user name from NAME.DAT.
bbs_name = _entry_name;
i = strposi (bbs_name,"D:",0); // Find "D:" in string.
if (i < 0)
i = strlen (bbs_name); // Not found: Use length.
for (--i; i>1; --i)
if (subchr (bbs_name,i)!=' ') break; // Delete trailing spaces.
setchr (bbs_name,i+1,0); // This is last character.
// Extract the first 8 alphabetic characters
// to get the short name.
c = 0;
error=strlen (bbs_name);
for (i=0; (error=subchr (bbs_name,i)) > 0; ++i)
{ if (isalpha(error=toupper(error)))
{ setchr (shortname,c,error);
++c;
if (c > 7) break;
}
}
setchr (shortname,c,0); // End string.
write (short,shortname); // Enter short name into global.
logfile = "LOG\"; // Logfile directory.
strcat (logfile,shortname);
stat = capture_stat(); // Check capture file status.
if (stat)
capture ("*CLOSE*");
entry (); // Update colors & status bar.
y = 1;
display (bbs_name,0,12); // Write it on the screen.
i = strlen (bbs_name);
y = display (" answered. ",i,12);
y = display("Opening log file... ",0,15);
fdelete (logfile); // Delete previous file.
if(capture(logfile) < 0)
y = display("LOG FILE NOT OPENED! ",0,15);
else
{ i = display ("Capturing into ",0,15);
y = display (_capture_fname,15,62);
}
write (bbsname,bbs_name); // Write BBS name to global.
i = call (ssl); // Find status line.
terminal();
pstraxy (" ",0,i,116);
pstraxy (bbs_name,1,i,116); // Write BBS name on status line.
goto